package com.ruoyi.project.zerocarbon.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.zerocarbon.mapper.DeclareFundsMapper;
import com.ruoyi.project.zerocarbon.domain.DeclareFunds;
import com.ruoyi.project.zerocarbon.service.IDeclareFundsService;

/**
 * 项目申报资金预算Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-03-13
 */
@Service
public class DeclareFundsServiceImpl implements IDeclareFundsService 
{
    @Autowired
    private DeclareFundsMapper declareFundsMapper;

    /**
     * 查询项目申报资金预算
     * 
     * @param id 项目申报资金预算ID
     * @return 项目申报资金预算
     */
    @Override
    public DeclareFunds selectDeclareFundsById(Long id)
    {
        return declareFundsMapper.selectDeclareFundsById(id);
    }

    /**
     * 查询项目申报资金预算列表
     * 
     * @param declareFunds 项目申报资金预算
     * @return 项目申报资金预算
     */
    @Override
    public List<DeclareFunds> selectDeclareFundsList(DeclareFunds declareFunds)
    {
        return declareFundsMapper.selectDeclareFundsList(declareFunds);
    }

    /**
     * 新增项目申报资金预算
     * 
     * @param declareFunds 项目申报资金预算
     * @return 结果
     */
    @Override
    public int insertDeclareFunds(DeclareFunds declareFunds)
    {
        declareFunds.setCreateTime(DateUtils.getNowDate());
        return declareFundsMapper.insertDeclareFunds(declareFunds);
    }

    /**
     * 修改项目申报资金预算
     * 
     * @param declareFunds 项目申报资金预算
     * @return 结果
     */
    @Override
    public int updateDeclareFunds(DeclareFunds declareFunds)
    {
        declareFunds.setUpdateTime(DateUtils.getNowDate());
        return declareFundsMapper.updateDeclareFunds(declareFunds);
    }

    /**
     * 批量删除项目申报资金预算
     * 
     * @param ids 需要删除的项目申报资金预算ID
     * @return 结果
     */
    @Override
    public int deleteDeclareFundsByIds(Long[] ids)
    {
        return declareFundsMapper.deleteDeclareFundsByIds(ids);
    }

    /**
     * 删除项目申报资金预算信息
     * 
     * @param id 项目申报资金预算ID
     * @return 结果
     */
    @Override
    public int deleteDeclareFundsById(Long id)
    {
        return declareFundsMapper.deleteDeclareFundsById(id);
    }
}
